<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Login extends CMS_Controller {

    function __construct() {
        parent::__construct();
        $this->parser->add_js('jquery-ui.min');
        $this->parser->add_js('functions');
        $this->parser->add_js('plugins');
        $this->parser->add_js('wl_Alert');
        $this->parser->add_js('wl_Dialog');
        $this->parser->add_js('wl_Form');
        $this->load->helper('form');
        $this->load->library('tank_auth');
        $this->load->library('permissions');
        if ($this->tank_auth->get_user_id()) {
            redirect(rtrim(base_url() . base_cms(), "/") . "/" . $this->permissions->get_url('login_home_index'));
        }
    }

    function index() {
        $this->lang->load('login_view');
        $v_dados = array();
        $v_dados['username'] = $this->lang->line('login_username');
        $v_dados['password'] = $this->lang->line('login_password');
        $v_dados['lost_password'] = $this->lang->line('login_lost_password');
        $v_dados['remember_me'] = $this->lang->line('login_remember_me');
        $v_dados['login'] = $this->lang->line('login_login');
        $v_dados['include_header'] = $this->lang->line('login_login');
        $v_dados['url_link'] = $this->permissions->get_url('login_auth_forgot_password');
        $v_dados['url_action'] = $this->permissions->get_url('login_auth_login');
        $this->parser->parse_cms('login_view', $v_dados);
    }

}

/* End of file login.php */
/* Location: ./application/controllers/login.php */